﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<ThietBiSo.LinQDB.Banner>" %>

<%@ Import Namespace="ThietBiSo.LinQDB" %>
<%@ Import Namespace="ThietBiSo.Models" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Website - bảng điều khiển
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table width="100%" cellpadding="2" cellspacing="0" border="0">
        <tr>
            <td>
                <table width="100%">
                    <tr>
                        <td>
                            <%= Html.ActionLink("Thêm banner", "Create",null, new { @class = "classThem" })%>
                        </td>
                        <td style="color:Red">Nếu chọn flash thì kích thước 1000 x 125</td>
                        <td align="right">
                            <%: Html.ActionLink("Quay lại", "quantri", "Admin", null, new { @class = "" })%>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <table id="bang_admin" class="tbl colorize" width="100%" border="0">
                    <tbody>
                        <tr>
                            <th width="100">
                                Sửa banner
                            </th>
                            <th align="center" width="50">
                                Banner
                            </th>
                            <th>
                                Loại
                            </th>
                            <th width="100" align="center">
                                Hiển thị
                            </th>
                            <th align="center" width="60">
                                Xóa
                            </th>
                        </tr>
                    </tbody>
                    <tbody>
                        <% foreach (Banner sp in (List<Banner>)ViewData["banners"])
                           {               
                        %>
                        <tr class="tb_hienthi">
                            <td>
                                <a href="<%=Url.Action("Edit","banner", new { id = sp.Id } ) %>">Banner
                                    <%:sp.Id %>
                                </a>
                            </td>
                            <td align="center" valign="middle">
                                <% if (sp.MaLoaiQuangCao == 1)
                                   { %>
                                <% if (sp.UrlHinh == "" || sp.UrlHinh == null || sp.UrlHinh == "noImage")
                                   { %>
                                <img src="<%:Url.Content("~/Content/images/nophoto.gif")%>" alt="" width="700px;"
                                    height="120px;" />
                                <%} %>
                                <img src="<%: sp.UrlHinh%>" alt="" width="700px;" height="120px;" />
                                <%}
                                   else if (sp.MaLoaiQuangCao == 2)
                                   { %>
                                <object width="700" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
                                    style="z-index: -1" id="Object4">
                                    <param name="movie" value="<%:sp.UrlHinh%>" />
                                    <param name="quality" value="high" />
                                    <param value="transparent" name="wmode" />
                                    <embed width="700" src="<%:sp.UrlHinh%>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer"
                                        type="application/x-shockwave-flash" bgcolor="" wmode="transparent" id="flashfirebug"
                                        name="flashfirebug_1355627846136" allowscriptaccess="always" allowfullscreen="true"
                                        allownetworking="all"></embed>
                                    <param name="allowFullScreen" value="true" />
                                    <param name="allowScriptAccess" value="always" />
                                    <param name="AllowNetworking" value="all" />
                                </object>
                                <%} %>
                            </td>
                            <td align="left">
                                <%: sp.LoaiQuangCao.TenLoaiQuangCao%>
                            </td>
                            <td align="center">
                                <%if (sp.HienThi == false)
                                  {
                                %>
                                <a href="javascript:banner_hienthi(<%:sp.Id%>);">
                                    <input type="checkbox" />
                                </a>
                                <%}
                                  else
                                  {%>
                                <a href="javascript:banner_hienthi(<%:sp.Id%>);">
                                    <input type="checkbox" checked="checked" /></a>
                                <%} %>
                            </td>
                            <td align="center">
                                <a href="javascript:banner_delete(<%:sp.Id %>);">
                                    <img src="../../Content/imagesAdmin/images/pic_trash.gif" alt="" /></a>
                            </td>
                        </tr>
                        <% } %>
                    </tbody>
                </table>
            </td>
        </tr>
    </table>
</asp:Content>
